CGI

CGI class * Designed to read the environment variables created by web server and will consume the data and make it easily accessible to program with.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

autoScrollInit
void autoScrollInit()

lazy javascript that you can use to tell the browser to keep scrolling down as you write content. This is handy if you said don't cache, and your web server is set up to not compress the returned data to browser.

discoverMimeType
void discoverMimeType(string extension)

set the class instance mime type to common mimetypes based on a file extension.

dump
void dump()

Dumps the contents of the CGI class to the page. Very useful for debuging

dumpEnv
void dumpEnv()

Dumps the system environment variables to the page.

exists
bool exists(string name)

Check if a cgi variable exists with the passed in name.

exists
bool exists(string name, int index)

Check if a cgi variable exists with the passed in name and index. keep in mind that the cgi environment can have multiple variables with the same name the passed in index allows us to specify which one to check for.

getCookie
COOKIE getCookie()

Get the cookie.

getErrorMsg
string getErrorMsg()

getter method for error_msg.

getFile
CGIFILE getFile(string name)

Get a file from the cgi enviroment of string name * returns a CGIFILE class.

getFile
CGIFILE getFile(string name, int index)
getFileContent
string getFileContent(string name)

Get the content of a file in the cgi environment with string name.

getFileContent
string getFileContent(string name, int index)

Get the content of a file in the cgi environment with string name and the index. keep in mind that we can have the same cgi variable with string name several times index allows us to specify which one we want.

getFileContentType
string getFileContentType(string name)

Get the file content type of the the file posted/put in the cgi envirnment with the variable string name.

getFileContentType
string getFileContentType(string name, int index)

Get the file content type of the the file posted/put in the cgi envirnment with the variable string name with the index. Keep in mind that a variable can exist multiple times in the cgi environment and the index allows us to specify exactly which one.

getFileName
string getFileName(string name)

Get the file name of the the file posted/put in the cgi envirnment with the variable string name.

getFileName
string getFileName(string name, int index)

Get the file name of the the file posted/put in the cgi envirnment with the variable string name with the index. Keep in mind that a variable can exist multiple times in the cgi environment and the index allows us to specify exactly which one.

getForwardVarString
string getForwardVarString()

create a string of the cgi variables that are in forward mode. * This allows us to use cgi variables to keep state and forward them on to another form submission. This allows the programmer * to selectivly forward and unforward cgi variables for flow/state control.

getMimeType
MIMETYPE getMimeType()

get the current MIMETYPE

getVal
string getVal(string name)

Get the value for the cgi variable for the passed in name

getVal
string getVal(string name, int index)

Get the value for the cgi variable for the passed in name and index. keep in mind that the cgi environment can have multiple variables of the same name the index allows us to specify which one we want.

getVal_m
string[] getVal_m(string name)

Since the cgi environment can have multiple variables we might want to get all the values.

getVarMode
CGIMODES getVarMode(string name)

Get the cgi Variable mode of a given name.

getVarMode
CGIMODES getVarMode(string name, int index)

Get the cgi Variable mode of a given name and index Keep in mind the cgi environment can contain multiple variables with the same name. The index allows us to get the one we want.

pageEnd
void pageEnd()

end the page being returned

pageEnd
void pageEnd(MIMETYPE type)
pageStart
void pageStart()

Print to standard out http headers initialize the page.

runAutoScroll
void runAutoScroll()

tell the browser to run the AutoScroll javascript.

setCookie
void setCookie(COOKIE cookie)

set the cookie.

setMimeType
void setMimeType(MIMETYPE type)

set the MIMETYPE.

setVal
void setVal(string name, string value, CGIMODES mode, CGI_VAR_TYPE type, CGIFILE fData)

* Instead of reading the cgi data only from the environment, we can set our own cgi variables from memory.

setVarMode
void setVarMode(string name, CGIMODES mode)

set the cgi Variable mode of a given name

setVarMode
void setVarMode(string name, CGIMODES mode, int index)

set the cgi Variable mode of a given name and index Keep in mind the cgi environment can contain multiple variables with the same name. The index allows us to get the one we want.

streamFile
void streamFile(string name)

stream the contents of a file back to the browser. you will have to store the file in the cgi class instance by setting a CGIVAL with CGIFILE class.

varIsFile
bool varIsFile(string name)

Check to see if a cgi variable with name is a file or not.

varIsFile
bool varIsFile(string name, int index)

Check to see if a cgi variable with name and index is a file or not. keep in mind that the cgi environments may contain several variables with same name. the index allows us to specify which one.

Meta